b751f703ed006cd3ec94a7af077d5c3849df310b,community/src/java/org/neo4j/impl/batchinsert/BatchInserter.java,BatchInserter,connectRelationship,#NodeRecord#NodeRecord#RelationshipRecord#,128

Before Change


        }
        if ( secondNode.getNextRel() != Record.NO_NEXT_RELATIONSHIP.intValue() )
        {
            RelationshipRecord nextRel = getRelationshipRecord( 
                secondNode.getNextRel() & 0xFFFFFFFFL );
            if ( nextRel.getFirstNode() == secondNode.getId() )
            {
                nextRel.setFirstPrevRel( rel.getId() );

After Change


        }
        if ( secondNode.getNextRel() != Record.NO_NEXT_RELATIONSHIP.intValue() )
        {
            RelationshipRecord nextRel = getRelationshipStore().getRecord(  
                secondNode.getNextRel() );
            if ( nextRel.getFirstNode() == secondNode.getId() )
            {
                nextRel.setFirstPrevRel( rel.getId() );
            }
            else if ( nextRel.getSecondNode() == secondNode.getId() )
            {
                nextRel.setSecondPrevRel( rel.getId() );
            }
            else
            {
                throw new RuntimeException( firstNode + " dont match "
                    + nextRel );
            }
            getRelationshipStore().updateRecord( nextRel );
        }
        firstNode.setNextRel( rel.getId() );
        secondNode.setNextRel( rel.getId() );